﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Sto0a03
    {
        private int? _checkno;
        private DateTime? _checkdate;
		private string _checktype;
		private string _usercode;
		private string _listid;
		
        /// <summary>
        /// 盘点号
        /// </summary>
		public int? Checkno
		{
			get { return _checkno;	 }
			set { _checkno=value;	}
		}
        /// <summary>
        /// 盘点日期
        /// </summary>
		public DateTime? Checkdate
		{
			get { return _checkdate;	 }
			set { _checkdate=value;	}
		}
        /// <summary>
        /// 盘点分类
        /// </summary>
		public string Checktype
		{
			get { return _checktype;	 }
			set { _checktype=value;	}
		}
        /// <summary>
        /// 用户名
        /// </summary>
		public string Usercode
		{
			get { return _usercode;	 }
			set { _usercode=value;	}
		}
        /// <summary>
        /// 主键标识
        /// </summary>
		public string Listid
		{
			get { return _listid;	 }
			set { _listid=value;	}
		}
		
		public static List<Sto0a03> GetSto0a03ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Sto0a03> list = new List<Sto0a03>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Sto0a03 model = GetSto0a03ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Sto0a03 GetSto0a03ByDataRow(DataRow dr)
		{
			Sto0a03 model = new Sto0a03(); //实例化Sto0a03
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("checkno")&&!(dr["checkno"] is System.DBNull))  
				model.Checkno = ( int)dr["checkno"];
			if (dcc.Contains("checkdate")&&!(dr["checkdate"] is System.DBNull))  
				model.Checkdate = ( DateTime)dr["checkdate"];
			if (dcc.Contains("checktype")&&!(dr["checktype"] is System.DBNull))  
				model.Checktype = ( string)dr["checktype"];
			if (dcc.Contains("usercode")&&!(dr["usercode"] is System.DBNull))  
				model.Usercode = ( string)dr["usercode"];
			if (dcc.Contains("listid")&&!(dr["listid"] is System.DBNull))  
				model.Listid = ( string)dr["listid"];
			
			return model;
		}
    }
}
